{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "91895f47",
   "metadata": {},
   "source": [
    "数据准备和数据预处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "0777e834",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 839 entries, 0 to 838\n",
      "Data columns (total 8 columns):\n",
      " #   Column    Non-Null Count  Dtype  \n",
      "---  ------    --------------  -----  \n",
      " 0   pclass    839 non-null    object \n",
      " 1   name      839 non-null    object \n",
      " 2   sex       839 non-null    object \n",
      " 3   age       633 non-null    float64\n",
      " 4   embarked  821 non-null    object \n",
      " 5   ticket    69 non-null     object \n",
      " 6   room      77 non-null     object \n",
      " 7   survived  839 non-null    int64  \n",
      "dtypes: float64(1), int64(1), object(6)\n",
      "memory usage: 52.6+ KB\n"
     ]
    }
   ],
   "source": [
    "import pandas as pd  # 读取数据\n",
    "dataset=pd.read_csv('/Users/somi/Downloads/机器学习ppt/03_dataset/item8/item8-ss-data-y.csv')\n",
    "#print(dataset)\n",
    "dataset.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2672ad31",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "     pclass  sex        age  embarked  survived\n",
      "0         0    0  29.000000         0         1\n",
      "1         0    0   2.000000         0         0\n",
      "2         0    1  30.000000         0         0\n",
      "3         0    0  25.000000         0         0\n",
      "4         0    1   0.916700         0         1\n",
      "..      ...  ...        ...       ...       ...\n",
      "834       2    1  31.194181         0         0\n",
      "835       2    1  20.000000         0         0\n",
      "836       2    1  37.000000         0         0\n",
      "837       2    1  28.000000         0         0\n",
      "838       2    1  19.000000         0         0\n",
      "\n",
      "[821 rows x 5 columns]\n",
      "<class 'pandas.core.frame.DataFrame'>\n",
      "Index: 821 entries, 0 to 838\n",
      "Data columns (total 5 columns):\n",
      " #   Column    Non-Null Count  Dtype  \n",
      "---  ------    --------------  -----  \n",
      " 0   pclass    821 non-null    int64  \n",
      " 1   sex       821 non-null    int64  \n",
      " 2   age       821 non-null    float64\n",
      " 3   embarked  821 non-null    int64  \n",
      " 4   survived  821 non-null    int64  \n",
      "dtypes: float64(1), int64(4)\n",
      "memory usage: 38.5 KB\n"
     ]
    }
   ],
   "source": [
    "#  数据预处理\n",
    "dataset.drop(['name','ticket','room'],inplace=True,axis=1)  # 删除值\n",
    "dataset['age']=dataset['age'].fillna(dataset['age'].mean())  #  填充缺失值\n",
    "dataset=dataset.dropna()  # 将pclass列转换为数值型数据，分别用0、1和2代替\n",
    "labels=dataset['pclass'].unique().tolist()\n",
    "\n",
    "dataset['pclass']=dataset['pclass'].apply(lambda x:labels.index(x))  # 将sex列转换为数值型数据，分别用0和1代替\n",
    "dataset['sex']=(dataset['sex']=='male').astype(int)  # 将embarked列转换为数值型数据，分别用0、1和2代替\n",
    "labels=dataset['embarked'].unique().tolist()\n",
    "dataset['embarked']=dataset['embarked'].apply(lambda x:labels.index(x))\n",
    "\n",
    "print(dataset)\n",
    "dataset.info()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1fccebca",
   "metadata": {},
   "source": [
    "调节参数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c278e1c2",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "最大预测准确率为：0.824242\n",
      "预测准确率最大的模型对应的参数值为：41\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAkEAAAGdCAYAAAAVEKdkAAAAOnRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjEwLjYsIGh0dHBzOi8vbWF0cGxvdGxpYi5vcmcvq6yFwwAAAAlwSFlzAAAPYQAAD2EBqD+naQAAQYFJREFUeJzt3X90VdWd///Xzc0vEpKbQEp+QMiNtf3oGEEN0iEQ9UOdUIZi/VRtdBgRCywZUUxh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np6uhEVFWVkZGQY3/72t43Dhw+b3+/s7DSefvppIy0tzYiJiTFuu+024+OPP7awxVfnV7/6lSHJ+OSTTwKOO/257ty5s9ef24ceesgwjP49xwsXLhiPPfaYMWrUKGPEiBHGN7/5Tdve/+Xut7Kyss/f4507dxqGYRhVVVXGbbfdZowaNcqIjo42vvzlLxtLliwx6urqrL2xXlzuXvv7c+uUZ3uln2PDMIyf/vSnxogRI4z6+voer3fSc73SZ41hhO731tXdIAAAgLBCTRAAAAhLhCAAABCWCEEAACAsEYIAAEBYIgQBAICwRAgCAABhiRAEAADCEiEIAACEJUIQAAAIS4QgAAAQlghBAAAgLBGCAABAWPr/AWHOJbRileC9AAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from sklearn.ensemble import RandomForestClassifier \n",
    "from sklearn.metrics import accuracy_score\n",
    "from sklearn.model_selection import train_test_split\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "#提取特征变量与标签\n",
    "x=dataset.iloc[:,:4].values\n",
    "y=dataset.iloc[:,4].values\n",
    "x_train,x_test,y_train,y_test=train_test_split(x,y,random_state=1,test_size=0.2)\n",
    "\n",
    "score=[]\n",
    "\n",
    "for i in range(0,200,10):\n",
    "    model=RandomForestClassifier(random_state=0,n_estimators=i+1)\n",
    "    model= model.fit(x_train,y_train)\n",
    "    pred=model.predict(x_test)\n",
    "    ac=accuracy_score(y_test,pred)\n",
    "    score.append(ac)\n",
    "print('最大预测准确率为：%f'%max(score))\n",
    "n=score.index(max(score))*10+1\n",
    "print('预测准确率最大的模型对应的参数值为：%.0f'%n)\n",
    "plt.plot(range(1,201,10),score)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b3d9821c",
   "metadata": {},
   "source": [
    "训练模型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "2d55d360",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "模型评估报告：\n",
      "              precision    recall  f1-score   support\n",
      "\n",
      "           0       0.86      0.83      0.84        93\n",
      "           1       0.79      0.82      0.80        72\n",
      "\n",
      "    accuracy                           0.82       165\n",
      "   macro avg       0.82      0.82      0.82       165\n",
      "weighted avg       0.83      0.82      0.82       165\n",
      "\n"
     ]
    }
   ],
   "source": [
    "from sklearn.metrics import classification_report\n",
    "model=RandomForestClassifier(random_state=0,n_estimators=41)\n",
    "model.fit(x_train,y_train)\n",
    "pred=model.predict(x_test)\n",
    "re=classification_report(y_test,pred)\n",
    "print('模型评估报告：')\n",
    "print(re)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5d6e9700",
   "metadata": {},
   "source": [
    "预测新数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "1e871263",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "需预测数据\n",
      "   pclass     sex  age     embarked            name  ticket   room\n",
      "0     1st    male   39    Cherbourg           Blank     NaN   A-31\n",
      "1     1st  female   30  Southampton   Miss Caroline     NaN    C-7\n",
      "2     1st  female   58  Southampton  Miss Elizabeth     NaN  C-103\n",
      "3     1st  female   45    Cherbourg           Bowen     NaN    NaN\n",
      "4     1st  female   22  Southampton        Bowerman     NaN    NaN\n",
      "5     2nd    male   34  Southampton      Mr William     NaN    NaN\n",
      "6     2nd  female   32  Southampton     Mrs William     NaN    NaN\n",
      "7     2nd    male   57  Southampton           Ashby     NaN    NaN\n",
      "8     2nd    male   18  Southampton          Bailey     NaN    NaN\n",
      "9     2nd    male   23  Southampton      Baimbrigge     NaN    NaN\n",
      "10    3rd    male   42  Southampton      Mr Anthony     NaN    NaN\n",
      "11    3rd    male   13  Southampton   Master Eugene     NaN    NaN\n",
      "12    3rd    male   16  Southampton    Mr Rossmore      NaN    NaN\n",
      "13    3rd  female   35  Southampton     Mrs Stanton     NaN    NaN\n",
      "14    3rd  female   16  Southampton      Miss Anna      NaN    NaN\n",
      "--------------------------------------------------------------------\n",
      "    pclass  sex  age  embarked            name  ticket   room\n",
      "0        0    1   39         0           Blank     NaN   A-31\n",
      "1        0    0   30         1   Miss Caroline     NaN    C-7\n",
      "2        0    0   58         1  Miss Elizabeth     NaN  C-103\n",
      "3        0    0   45         0           Bowen     NaN    NaN\n",
      "4        0    0   22         1        Bowerman     NaN    NaN\n",
      "5        1    1   34         1      Mr William     NaN    NaN\n",
      "6        1    0   32         1     Mrs William     NaN    NaN\n",
      "7        1    1   57         1           Ashby     NaN    NaN\n",
      "8        1    1   18         1          Bailey     NaN    NaN\n",
      "9        1    1   23         1      Baimbrigge     NaN    NaN\n",
      "10       2    1   42         1      Mr Anthony     NaN    NaN\n",
      "11       2    1   13         1   Master Eugene     NaN    NaN\n",
      "12       2    1   16         1    Mr Rossmore      NaN    NaN\n",
      "13       2    0   35         1     Mrs Stanton     NaN    NaN\n",
      "14       2    0   16         1      Miss Anna      NaN    NaN\n"
     ]
    }
   ],
   "source": [
    "test=pd.read_csv('/Users/somi/Downloads/机器学习ppt/03_dataset/item8/item8-ss-test-y.csv')\n",
    "print('需预测数据')\n",
    "print(test)  # 处理数据\n",
    "print ('--------------------------------------------------------------------')\n",
    "\n",
    "# 将pclass列转换为数值型数据，分别用0、1和2代替\n",
    "labels=test['pclass'].unique().tolist()\n",
    "test['pclass']=test['pclass'].apply(lambda x:labels.index(x)) \n",
    "\n",
    "# 将sex列转换为数值型数据，分别用0和1代替\n",
    "test['sex']=(test['sex']=='male').astype(int)\n",
    "\n",
    "# 将embarked列转换为数值型数据，分别用0、1和2代替\n",
    "labels=test['embarked'].unique().tolist()\n",
    "test['embarked']=test['embarked'].apply(lambda x:labels.index(x))\n",
    "print(test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "3fd002af",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Miss Caroline能够获救\n",
      "Miss Elizabeth能够获救\n",
      "Bowen能够获救\n",
      "Bowerman能够获救\n",
      "Mrs William能够获救\n",
      "Bailey能够获救\n",
      "Mrs Stanton能够获救\n",
      "Miss Anna 能够获救\n",
      "Miss Anna 不能获救\n"
     ]
    }
   ],
   "source": [
    "x_new=test.iloc[:,:4].values  \n",
    "names=test.iloc[:,4].values  \n",
    "pred=model.predict(x_new)\n",
    "for result,name in zip(pred,names):\n",
    " if result==1:\n",
    "    print(name+\"能够获救\")\n",
    "else:\n",
    "    print(name+\"不能获救\")"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "ml-course",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
